<?php

namespace App\Console\Commands;

use App\Models\ClockRecord;
use App\Models\Record;
use Illuminate\Console\Command;

class SendEmails extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:name';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //查看  打卡时间是否开启
        ClockRecord::query()->where('start_time', '<', time())->update(['status' => 1]);
        //查看  打卡任务是否结束。自动关闭
        ClockRecord::query()->where('stop_time', '<', time())->update(['status' => 2]);


    }
}
